Even though this is syntactically correct, the void
return type should not be used in the signature of a constructor. Indeed some
developers might be confused by this syntax, believing that the constructor is in fact a standard function.
Noncompliant code example
public class Foo
{
public function Foo() : void
{...}
}
Compliant solution
public class Foo
{
public function Foo()
{...}
}